import asyncio

def hello(name):
    print(f'[hello] Hello,{name}')

async def work(t,name):
    print(f'[work{name}]start')
    await asyncio.sleep(t)
    print(f'[work{name}]stop')

def main():
    loop=asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    asyncio.ensure_future(work(1,'A'))
    loop.call_later(1.2,hello,'Tom')
    loop.call_soon(hello,'Kitty')
    task4=loop.create_task(work(2,'B'))
    loop.call_later(1,hello,'Jerry')
    loop.run_until_complete(task4)

main()
